home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / GES.CMD < prev    next >
Encoding:
Text File  |  1996-02-16  |  1.8 KB  |  112 lines

  1. #    Login.cmd for Global Enterprises Services, Inc.
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter your dial up phone number"]
  9.     save $number
  10.   end
  11. end
  12. if ![load $username]
  13.   if [username "Enter your login username"]
  14.     save $username
  15.   end
  16. end
  17. if ![load $password]
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21. end
  22. if ![load $modemsetup]
  23.   if [query $modemsetup "Enter your modem initialization string"]
  24.     save $modemsetup
  25.   end
  26. end
  27. $prompt = ">"
  28. $userprompt = "name:"
  29. $passprompt = "word:"
  30. $slipcmd = "slip default"
  31. $addrtarg = "address is"
  32. $pppcmd = "ppp"
  33.  
  34. %attempts = 10
  35. #
  36. #
  37. #----------------------------------------------------------
  38. #
  39. # initialize modem
  40. #
  41. output "atz"\13
  42. if ! [input 10 OK\n]
  43.   display "Modem is not responding"\n
  44.   abort
  45. end
  46. #
  47. # setup our modem commands
  48. #
  49. output $modemsetup\13
  50. input 10 OK\n
  51. #
  52. # send phone number
  53. #
  54. %n = 0
  55. repeat
  56.   if %n = %attempts
  57.     display "Too many dial attempts"\n
  58.     abort
  59.   end
  60.   output "atdt"$number\13
  61.   %ok = [input 60 CONNECT]
  62.   %n = %n + 1
  63. until %ok
  64. input 10 \n
  65. #
  66. #  wait for the username prompt
  67. #
  68. input 30 $userprompt
  69. output $username\13
  70. #
  71. # and the password
  72. #
  73. input 30 $passprompt
  74. output $password\13
  75. #
  76. # we are now logged in
  77. #
  78. input 30 $prompt
  79. if %ppp
  80.   #
  81.   # jump into ppp mode
  82.   #
  83.   output $pppcmd\13
  84.   #
  85.   input 30 \n
  86.   #
  87.   display "PPP mode selected.  Will try to negotiate IP address."\n
  88.   #
  89. else
  90.   #
  91.   # jump into slip mode
  92.   #
  93.   output $slipcmd\13
  94.   #
  95.   # wait for the address string
  96.   #
  97.   input 30 $addrtarg
  98.   #
  99.   # parse address
  100.   #
  101.   address 30
  102.   input 30 \n
  103.   #
  104.   # we are now connected, logged in and in slip mode.
  105.   #
  106.   display \n
  107.   display Connected.  Your IP address is \i.\n
  108. end
  109. #
  110. # now we are finished.
  111. #
  112.